_ReminderList2Markdown
(
50
actions, 32 KB)
0 Get Dictionary from
[Shortcut Input]
»
2
4
6
8
42
1 Comment
@params: ────────────── • Required parameter: • listName (Text) • Optional parameter: • numberOfListItems (Number) • setAsCompleted (Boolean)
2 Find Reminders »
3
5
8
11
14
ContentItemFilter
:
• All the following are true List is
[0 Dictionary
.listName
]
Is Not Completed
3 If
[2 Reminders]
has any value
4 If
[0 Dictionary
.numberOfListItems
]
has any value
5 Count Items in
[2 Reminders]
»
7
6 Get Numbers from
[0 Dictionary
.numberOfListItems
]
»
7 If
[6 Numbers]
<
[5 Count]
8 Get
Items in Range
1
to
[0 Dictionary
.numberOfListItems
]
from List
[2 Reminders]
»
9 Set Variable
myReminders
to
[8 Item from List]
10 Otherwise
11 Set Variable
myReminders
to
[2 Reminders]
12 End If
13 Otherwise ▵
4
14 Set Variable
myReminders
to
[2 Reminders]
15 End If
16 Repeat with Each in
[myReminders]
17 If
[Repeat Item
’s URL
]
has any value
18 Text
* [
[Repeat Item]
](
[Repeat Item
’s URL
]
)
19 Otherwise
20 Text
*
[Repeat Item]
21 End If »
22 Set Variable
listItemTemp
to
[21 If Result]
23 Text
➔ Tab
»
30
32
\u{tab}
24 If
[Repeat Item
’s Notes
]
has any value
25 Split Text
[Repeat Item
’s Notes
]
by New Lines »
26 Repeat[2] with Each in
[25 Split Text]
27 If
[Repeat Item 2]
has any value
28 Match Text
^[1-9]
in
[Repeat Item 2]
»
29 If
[28 Matches]
has any value
30 Text
[23 Tab]
[Repeat Item 2]
31 Otherwise
32 Text
[23 Tab]
+
[Repeat Item 2]
33 End If »
34 Add
[33 If Result]
to Variable
listItemTemp
35 End If ▵
27
36 End Repeat[2] with Each ▵
26
37 End If ▵
24
38 Combine Text
[listItemTemp]
with New Lines »
39 Add
[38 Combined Text]
to Variable
listItem
40 Text
➔ ""
»
41 Set Variable
listItemTemp
to
[40 ""]
42 Get Dictionary Value for
setAsCompleted
in
[0 Dictionary]
»
43 If
[42 Dictionary Value
as Boolean
]
is true
44
Set
Is Completed
of Reminder
[Repeat Item]
ReminderContentItemIsCompleted
:
1
45 End If
46 End Repeat with Each ▵
16
47 Combine Text
[listItem]
with New Lines
➔ markdownContent
»
48 Stop and Output
[47 markdownContent]
49 End If ▵
3